import Vue from 'vue'
import Router from 'vue-router'
import HomePage from '@/views/homepage/homepage'
import HomePage1 from '@/views/homepage1/homepage'
import Schedule from '@/views/schedulepage/schedule'

import demo from './demo'

Vue.use(Router)

const router = new Router({
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index',
            name: 'index',
            component: HomePage
        },
        {
            path: '/index1',
            name: 'index1',
            component: HomePage1
        },
        {
            path: '/vote',
            name: 'vote',
            component: () => import('@/views/vote/vote')
        },
        {
            path: '/voteresult',
            name: 'voteresult',
            component: () => import('@/views/voteresult/voteresult')
        },
        {
            path: '/schedule',
            name: 'schedule',
            component: Schedule
        },
        {
            path: '/question',
            name: 'question',
            component: () => import('@/views/question/question')
        },
        // 匹配球友力活动 START
        {
            path: '/matchactivity',
            redirect: '/matchactivity/find'
        },
        {
            path: '/matchactivity',
            component: resolve => require(['@/views/matchactivity/index/MatchActivityIndex.vue'], resolve),
            children: [
                {
                    path: 'teammate',
                    component: resolve => require(['@/views/matchactivity/FindTeammate.vue'], resolve)
                },
                {
                    path: 'find',
                    component: resolve => require(['@/views/matchactivity/discover/Discover.vue'], resolve)
                }
            ]

        },
        // 匹配球友力活动 END
        ...demo
    ]
});

export default router;
